<script type="text/javascript">
window.history.forward(1);
</script>
<a href="/"><div class="topBack"><img src="/images/back_jiantou.png" style="width:40px;height:40px;"></div></a>
<div class="topContent">商品详情</div>
<div class="topRight">&nbsp;</div>
<div class="clear"></div>
<?php 
	if(empty($this->res)){
		echo '
		<div style="text-align:center;"><img src="/images/none.jpg" style="width:50%;padding-top:110px;"></div>
		<div style="text-align:center;">暂无商品详情</div>';
	}else{
		echo '
			<div id="wrapperDetails" class="wrapperComman" style="top:40px;">
			<div class="scroller">
				<div style="text-align:center;padding:20px 10px;">
					<img src="'.$this->res->imgurl.'" style="width:50%;">
				</div>
				<div class="normalDiv">【品名】：<span class="skuD_title">'.$this->res->skuname.'</span></div>
				<div class="normalDiv">【规格】：<span class="skuD_avg">'.$this->res->spec.'</span></div>
				<div class="normalDiv">【价格】：';
				if($this->res->onsale==1){
					echo '￥<span style="font-size:1.1em;color:red;">'.$this->res->saleprice.'</span> ￥<span style="text-decoration: line-through;">'.$this->res->price.'</span>';
				}else{
					echo '￥<span style="font-size:1.1em;color:red;">'.$this->res->price.'</span>';
				}
				
				echo '</div>
				<div class="normalDiv">【描述】：<span style="font-size:0.9em;padding:5px;">'.$this->res->remark.'</span></div>
			';
				if(!empty($this->res->imageList)){
					foreach($this->res->imageList as $i){
						echo '<img src="'.$i->imgurl.'" style="width:100%;">';
					}	
				}
			echo '
			</div>
			</div>
		';
		
		echo '
			<div class="index_bottom">
				<ul class="ul_hen">
					<li style="width:40%;margin-top:15px;font-size:1.2em;">放入购物车</li>
					<li style="width:30%;margin-top:15px;font-size:1.2em;font-weight:bold">
						<span id="detailMinus" onclick="javascript:detailMinus();return false;" style="border:1px solid #F75C19;padding:5px;border-radius:3px;" skuId="'.$this->res->skuid.'" custId="0" skuOnsale="'.$this->res->onsale.'" skuName="'.$this->res->skuname.'" skuPrice="';
						if($this->res->onsale==1){
							echo $this->res->saleprice;
						}else{
							echo $this->res->price;
						}
						echo '" skuWeight="'.$this->res->avgweight.'" skuSaleAmount="'.$this->res->saleamount.'" skuSalePrice="'.$this->res->saleprice.'">
							-
						</span>
						<span style="padding-left:10px;" id="detail-'.$this->res->skuid.'">0</span>
						<span  onclick="javascript:detailAdd();return false;" style="border:1px solid #F75C19;padding:5px;border-radius:3px;margin-left:5%;"skuId="'.$this->res->skuid.'" custId="0">
							+
						</span>
					</li>
					<li style="padding-top:0px;margin-top:5px;width:20%;position:relative;bottom:20px;float:right;margin-right:10px;" onclick="javascript:detailCart();return false;">
						<span class="cart_bg"><span class="cart_num detailCart" id="cart_num">0</span></span>
					</li>
				</ul>
			</div>
		';
	}
?>


<script type="text/javascript">
	$(document).ready(function(){
		loadCookieDetails();
	});
    var myscroll;
    function loaded(){
       setTimeout(function(){
                myscroll=new iScroll("wrapperDetails");
         },100 );
    }
    window.addEventListener("load",loaded,false);
	function detailCart(){
		var cook = getCookie('cartCountPrice');
		var cartCountPriceList = cookToArr(cook);
		if(isNull(cartCountPriceList)){
			alert('亲，您的购物车空空如也！');
			return false;
		}else{
			setCookie('tab','cart');
			location.href='/';
		}
	}
</script>